package com.jwt.authcserver.service.impl;

import com.jwt.authcserver.mapper.UserMapper;
import com.jwt.authcserver.pojo.User;
import com.jwt.authcserver.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @Description: 用户实现类
 * @author: suichen
 * @date: 2021年10月12日 22:44
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper mapper;

    @Override
    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
        User user = mapper.queryByUserName(s);
        return user;
    }
}
